import React, { FC, HTMLAttributes } from 'react'
import classNames from 'classnames'
import TimelineItem, { TimelineItemProps } from './TimelineItem'
import './index.less'

const PRE_CLS = 'stdTimeline'

interface TimelineProps extends FC<HTMLAttributes<HTMLElement>> {
  Item: FC<TimelineItemProps>
}
const Timeline: TimelineProps = props => {
  const { className, children, ...restProps } = props
  const classes = classNames(PRE_CLS, className)

  return (
    <section className={classes} {...restProps}>
      {children}
    </section>
  )
}

Timeline.Item = TimelineItem

export default Timeline
